<template>
    <div>
        <van-nav-bar id="reset" title="我的信息" left-arrow @click-left="backHandle" fixed z-index="100" />
        <div class="pageCon fuPage">
            <div class="topBox"></div>
            <div class="userInfo">
                <img :src="user.userImg" mode="">
                <div>{{ user.userName }}</div>
            </div>
            <div class="navBox" @click="toPage('/userInfo')">
                <div>
                    <img src="../../assets/user/wenjuan.png" mode="" />
                    <div>
                        <span>基础信息</span>
                        <span>用户需填写基本内容，完善资料</span>
                    </div>
                </div>
                <div>共4项</div>
            </div>
            <div class="navBox" @click="toPage('/healthRecords')">
                <div>
                    <img src="../../assets/user/tijian.png" mode="" />
                    <div>
                        <span>健康档案</span>
                        <span>上传病例图片</span>
                    </div>
                </div>
                <div></div>
            </div>

            <div @click="outHandle" class="outBtn">退出当前账户</div>
        </div>
    </div>

</template>

<script>
import Vue from 'vue'
export default {
    name: 'HomeR',
    data() {
        return {
            user: JSON.parse(localStorage.user)
        }
    },
    mounted() {

    },
    methods: {

        backHandle() {
            this.$router.back()
        },

        toPage(url) {
            this.$router.push(url)
        },

        outHandle() {
            this.$dialog.confirm({
                title: '提示',
                message: '是否退出当前账户',
                cancelButtonText: '取消',
                confirmButtonText: '确认退出'
            })
                .then(() => {

                    localStorage.removeItem('user')
                    // localStorage.clear()
                    this.$router.replace('/wxLogin')

                })
                .catch(() => {
                    // on cancel
                    // this.tipShow = true
                });


        },



    },
    created() {
    },
    //计算属性
    computed: {

    },
    filters: {

    }

}

</script>

<style lang='less' scoped>
.pageCon {

    position: relative;
    width: 100%;
    height: 100vh;
    background-color: #EEF1F7;
    overflow: hidden;
}

.topBox {
    position: absolute;
    top: -2718px;
    left: -1125px;
    width: 3000px;
    height: 3000px;
    background: #FFFFFF;
    border-radius: 50%;
    z-index: 1;
}

.userInfo {
    position: relative;
    margin: 90px 0 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    font-weight: bold;
    font-size: 36px;
    color: #333333;
    z-index: 2;
}

.userInfo>img {
    margin-bottom: 20px;
    width: 156px;
    height: 156px;
    border-radius: 50%;
    background-color: #fff;
    border: 2px solid #fff;
}

.navBox {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 auto 40px;
    width: 690px;
    height: 162px;
    background: #FFFFFF;
    box-shadow: 0px 2px 6px 0px rgba(51, 51, 51, 0.08);
    border-radius: 18px;
    font-family: Source Han Sans CN;
}

.navBox>div {
    box-sizing: border-box;
    padding: 48px 40px;
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 28px;
    color: #333333;
}

.navBox>div>div {
    display: flex;
    flex-direction: column;
}

.navBox>div>div>span:last-child {
    font-weight: 400;
    font-size: 20px;
    color: #858B90;
}

.navBox>div>img {
    margin-right: 30px;
    width: 64px;
    height: 64px;
}

.navBox>div:last-child {
    font-weight: 400;
    font-size: 20px;
    color: #858B90;
}

.topNavBox {
    z-index: 100 !important;
}

#reset /deep/ .van-nav-bar__left .van-nav-bar__text,
#reset /deep/ .van-nav-bar__left .van-icon {
    color: #333 !important;
}

.outBtn {
    margin: 100px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 564px;
    height: 72px;
    background: linear-gradient(146deg, #14A870, #20BB66);
    box-shadow: 0px 2px 6px 0px rgba(51, 51, 51, 0.08);
    border-radius: 36px;
    border: 1px solid #0E9249;
    font-family: Source Han Sans CN;
    font-weight: bold;
    font-size: 28px;
    color: #FFFFFF;
}
</style>